/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.figmania.modelo;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.*;
import org.hibernate.annotations.Cascade;

/**
 *
 * @author Henrique
 */
@Entity
@Table (name="album", schema="figmania")
public class Album implements Serializable {
    
    @Id
    private int id_album;
    private String titulo;
    private String tema;
    @Temporal(javax.persistence.TemporalType.DATE)
    private java.util.Date data_lancamento;
    private String descricao;
    
    @OneToMany(mappedBy ="album", fetch=FetchType.LAZY)
    @Cascade(org.hibernate.annotations.CascadeType.ALL)
    private Collection<PacoteFigurinha> pacoteFigurinha;
    
    @ManyToMany (fetch=FetchType.EAGER)
    @JoinTable (name="usuario_adquire_album", schema="figmania",
            joinColumns=@JoinColumn(name="id_album"),
            inverseJoinColumns=@JoinColumn(name="id_usuario"))
    private Collection<Usuario> usuario;

    public Date getData_lancamento() {
        return data_lancamento;
    }

    public String getDescricao() {
        return descricao;
    }

    public int getId_album() {
        return id_album;
    }

    public String getTema() {
        return tema;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setData_lancamento(Date data_lancamento) {
        this.data_lancamento = data_lancamento;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public void setId_album(int id_album) {
        this.id_album = id_album;
    }

    public void setTema(String tema) {
        this.tema = tema;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }
    
    
}
